home *** CD-ROM | disk | FTP | other *** search
- AR(1) Last changed: 8-19-98
-
-
- NNAAMMEE
- aarr - archive and library maintainer
-
- SSYYNNOOPPSSIISS
- ar -d [-lv] archive file ...
- ar -m [-lv] [-abi] [posname] archive file ...
- ar -p [-ls] archive [file ...]
- ar -q [-clzf] archive file ...
- ar -r [-cuvsfl] [-abi] [posname] archive file ...
- ar -t [-vs] archive [file ...]
- ar -x [-vosCT] archive [file ...]
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- The archiver (aarr) maintains groups of files as a single archive file.
- Generally, you use this utility to create and update library files
- that the link editor uses; however, you can use the archiver for any
- similar purpose.
-
- This version of aarr produces both 32-bit and 64-bit archives. The 32-
- bit archive format is defined in the System V Release 4 ABI. The 64-
- bit archive format is defined in the 64-bit ELF OBJECT File
- Specification. 32-bit objects and 64-bit objects cannot be mixed in
- an archive. The first object determines whether the archive will be
- 32-bit or 64-bit, if the archive does not exist to begin with. In
- compilers of version 7.x and higher, the archiver also archives WHIRL
- objects. Mixing is allowed between 32-bit relocatable ELF objects and
- 32-bit WHIRL objects, and between 64-bit relocatable ELF objects and
- 64-bit WHIRL objects. Different versions of WHIRL objects are NOT
- mixable.
-
- If the environment variable _XPG is defined, _a_r operates in
- conformance with the X/Open XPG4 specifications. The format of the
- output may differ in accordance to the XPG4 standards. Changes are
- either in the exit status or the format of the output.
-
- Any option that changes an object library causes the archive-symbol-
- table to be updated. This makes adding one file at a time to a
- library very slow.
-
- Useless options (such as using option --uu with option --tt) are not
- diagnosed.
-
- NNOOTTEE:: aarr uses a portable ASCII-format archive that you can use on
- various machines that run UNIX.
-
- Options are documented here with a leading hyphen(-) form. An older
- form with all option letters together and no leading hyphen is still
- supported. The first example below shows the old form.
-
- Examples:
-
- ar cr lib.a a.o b.o
- ar -c -r lib.a a.o b.o
- ar -cr lib.a a.o b.o
-
- Options are:
-
- --aa Position new files in the archive after the file named by the
- _p_o_s_n_a_m_e operand. Use this suboption with the mm or rr options.
-
- --bb Position new files in the archive before the file named by the
- _p_o_s_n_a_m_e operand. Use this suboption with the mm or rr options.
-
- --cc Suppress the normal message that the archiver prints when it
- creates the archive file _a_r_c_h_i_v_e. Normally, the archiver creates
- the specified archiver file when it needs to.
-
- --CC Prevent extracted files from replacing like-named files in the
- file system. This option is useful when --TT is also used, to
- prevent truncated names from replacing files with the same
- prefix.
-
- --dd Delete the specified _f_i_l_es from _a_r_c_h_i_v_e.
-
- --ii Position new files in the archive before the file named by the
- _p_o_s_n_a_m_e operand (equivalent to --bb). Use this suboption with the
- --mm or --rr options.
-
- --ff Adds padding to the end of each object file archived, using the
- character '\0'. This enables the loader (lldd) to have faster
- access to members in the archive while performing static linking.
- _W_a_r_n_i_n_g: this option results in the change in size of files
- permanently, normally increased by 1 to 15 bytes. In compiler
- releases 7.1 and higher, this option is the default.
-
- --ll Puts temporary files in the local directory. If option --ll is not
- supplied and the environment variable TTMMPPDDIIRR is defined then
- TTMMPPDDIIRR's value is used as the name of the directory for temporary
- files. If neither option --ll nor TTMMPPDDIIRR is supplied, the archiver
- puts its temporary files in the directory /_t_m_p.
-
- --mm Moves the specified files to the end of the archive. If you
- specify a positioning character, you must also specify the
- _p_o_s_n_a_m_e (as in option --rr)) to tell the archiver where to move the
- files.
-
- --oo Force each newly created file to have the `last modified' date
- that it had before it was extracted from the archive.
-
- --pp Prints the contents of the _f_i_l_es from _a_r_c_h_i_v_e to the standard
- output. If no _f_i_l_e_s are specified, the contents of all files in
- the archive will be written in the order of the archive.
-
- --qq Append the specified files to the end of the archive file. The
- archiver does not accept suboption positioning characters with
- the --qq option. It also does not check whether the files you want
- to add already exist in the archive. This is useful to bypass
- the searching otherwise done when creating a large archive piece
- by piece. Since the archive-symbol-table of an object library is
- updated with --qq it is advisable to add as many files as possible
- in one execution of _a_r. Only --qqzz (see --zz below) avoids quadratic
- behavior when creating a large object archive piece by piece.
-
- --rr Replace or add _f_i_l_es to _a_r_c_h_i_v_e. If the archive named by _a_r_c_h_i_v_e
- does not exist, a new archive file will be created and a
- diagnostic message will be written to standard error (unless the
- --cc option is specified). If no _f_i_l_es are specified and the
- _a_r_c_h_i_v_e exists, nothing is done. Files that replace existing
- files will not change the order of the archive. If you use the
- suboption --uu with --rr,, the archiver only replaces those files that
- have `last-modified' dates later than the archive files. If you
- use a positioning character (from the set aabbii)) you must specify
- the _p_o_s_n_a_m_e argument to tell the archiver to put the new files
- after (aa) or before (bb or ii). Otherwise, the archiver puts new
- files at the end of the archive.
-
- --ss Makes an archive-symbol-table file in the archive. The --ss option
- is automatically added when any of the options --dd, --mm, or --rr is
- requested.
-
- If you specify --ss, the archiver creates the archive-symbol-table
- file as its last action before finishing execution. You must
- specify at least one other archive option (mm, pp, dd, rr, or tt) when
- you use the --ss option.
-
- --tt Write a table of contents for the files in _a_r_c_h_i_v_e to the
- standard output. If you don't specify any file names, write a
- table of contents for all files in the order of the archave. If
- you specify file names, the archiver writes a table of contents
- only for those files.
-
- --TT Allow filename truncation of extracted files whose archive names
- are longer than the file system can support. By default,
- extracting a file with a name that is too long is an error; a
- diagnostic message will be written and the file will not be
- extracted.
-
- --uu Update older files. When used with the --rr option, files within
- the archive will be replaced only if the corresponding _f_i_l_e is
- newer than the existing _a_r_c_h_i_v_e file. This option uses the UNIX
- system `last-modified' date for this comparison. --uu gives no
- warning when replacement is refused.
-
- --vv Gives a verbose file-by-file description as the archiver makes a
- new archive file from an old archive and its constituent files.
- When you use this option with --tt,, the archiver lists, on standard
- output, all information about the files in the archive. When you
- use this option with --pp, the archiver writes the name of the file
- to standard output before writing the file itself to standard
- output. If you add a second --vv additional informational messages
- can appear.
-
- --xx Extract the files named by the _f_i_l_e operands from the _a_r_c_h_i_v_e.
- The contents of the archive file will not be changed. If you
- don't specify any file names, the archiver extracts all files.
- Normally, the `last-modified' date for each extracted file shows
- the date when someone extracted it; however, when you use --oo,, the
- archiver resets the `last-modified' date to the date recorded in
- the archive.
-
- --zz Only be useful with --qq. --qqzz supresses updating of the archive-
- symbol-table and updates the archive in-place. The resulting
- archive cannot be used with _l_d (and is not a System V Release 4
- ABI compliant archive) until an archive-symbol-table update is
- done. lldd(1) will fail with a message suggesting use of aarr --ttss if
- the last change to the archive uses --qqzz: Use of --qqzz is
- discouraged: the updates are not checked for duplications and in
- case of a file or other error the archive may be destroyed. If
- any file name added is longer than 15 characters, line _q_z updates
- the archive-symbol-table even with --qqzz. If all file names added
- with qqzz on a particular execution are 15 characters or less the
- archive-symbol-table update is suppressed (even if some file
- names already in the archive are longer than 15 characters). xx
- option.
-
- NNOOTTEESS
- There is no _r_a_n_l_i_b program in IRIX. Option --ss creates the archive-
- symbol-table _l_d uses.
-
- Options --rr, --dd, --mm, and --qq imply option --ss. Since option --ss creates
- an archive-symbol-table, creating an object library by executing _a_r
- once per object file will be very slow. Creating an object library
- with a single execution of _a_r is much faster.
-
- DDIIAAGGNNOOSSTTIICCSS
- xxxxxxxxxx nnoott ffoouunndd
- The file xxxxxxxxxx was not found in the archive. It could mean a
- simple misspelling, but it could also mean that you supplied
- xxxxxxxxxx more than the number of times xxxxxxxxxx appears in the archive!
- Files not found change the exit code from _a_r but any attempted
- update of the archive (by option rr for example) is not
- suppressed.
-
- ""nnoott iinn aarrcchhiivvee ffoorrmmaatt""
- You probably forgot to specify the archive name in the
- command. The _a_r_c_h_i_v_e mentioned in the synopsis should be the
- archive name.
-
- The diagnostics "s - creating Symbol hash table" and "s - done" are no
- longer emitted when --vv is used (to make the -v output standard-
- conforming). If you really want to see those messages, add a second
- v, as in --vvvv.
-
- MMOORREE NNOOTTEESS
- The behavior documented in this section is not guaranteed to remain
- the same across releases. This section is provided as help in case _a_r
- does something surprising.
-
- If there is only one hard link (ie, at most one non-symbolic link) to
- an archive which is being updated then an old archive contents are
- replaced by the new contents by rreennaammee(2). (For more information on
- symbolic and hard links, see llnn(2).) Otherwise, when updating,
- replacement is by copying the new data onto the old file. If the
- archive is updated, the replacement archive is built in the same
- directory as the named archive (after following symbolic links to the
- location of the named archive).
-
- In case the copy operation mentioned above is interrupted in mid-copy
- (which is normally not possible) _a_r will attempt to set the archive
- length to 0 and the modification-date to January 1, 1970 as a hint
- that the archive is not usable.
-
- If the _a_r command results in an unchanged archive, the old archive
- will not be replaced. This is best achieved with, for example, _a_r _r_u
- _l_i_b._a _x._o; if the named object file is not put into the archive, the
- archive is not modified. The definition of unchanged is very
- conservative: _a_r _r _l_i_b._a _x._o, for example, always changes the
- archive since x.o is added or replaced (even though x.o itself may be
- unchanged).
-
- The following is a sampling of traditional _a_r behaviors that you may
- find surprising.
-
- If you specify the same file twice in an argument list, it can appear
- twice in the archive file.
-
- The oo option does not change the `last-modified' date of a file unless
- you own the extracted file or you are the super-user.
-
- Trailing slashes are removed from file-path-names. Only the final
- component of a file-path-name is recorded in an archive. For example,
- in //aa//bb//cc//ddffiillee////////, the file searched for is //aa//bb//cc//ddffiillee, and the
- name recorded in the archive is ddffiillee.
-
- If you give _a_r the same name twice in an aarr xx command the second
- instance of the name will provoke a ``not found'' message.
-
- FFIILLEESS
- /tmp/ar.tmp.v* or TMPDIR/ar.tmp.v* temporaries
-
- SSEEEE AALLSSOO
- lloorrddeerr((11)),, lldd((11)),, aarr(4)
-
- _S_y_s_t_e_m _V _A_p_p_l_i_c_a_t_i_o_n _B_i_n_a_r_y _I_n_t_e_r_f_a_c_e, ISBN 0-13-877598-2, Prentice
- Hall
-
- This man page is available only online.
-
-